@extends('admin.layout')
@section('title',$title)
@section('content')
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                订单管理
                <small>这是后台管理页</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="/admin/order/index"><i class="fa fa-dashboard"></i> 订单列表</a></li> 

            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">订单编辑</h3>
                            <!-- 订单添加失败提示信息 -->
                            @if (session('error'))
                                <div class="alert alert-danger alert-dismissable">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                    <h4><i class="icon fa fa-ban"></i> 警告!</h4>
                                            <li>{{ session('error') }}</li>
                                </div>
                            @endif
                            <!-- 订单名已存在提示框 -->
                             @if (session('oldusername'))
                                <div class="alert alert-danger alert-dismissable">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                    <h4><i class="icon fa fa-ban"></i> 警告!</h4>
                                            <li>{{ session('oldusername') }}</li>
                                </div>
                            @endif
                            <!-- 错误提示框 -->
                            @if (count($errors) > 0)
                                <div class="alert alert-danger alert-dismissable">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                    <h4><i class="icon fa fa-ban"></i> 警告!</h4>
                                    <ol>
                                        @foreach ($errors->all() as $error)
                                            <li>{{ $error }}</li>
                                        @endforeach
                                    </ol>
                                </div>
                            @endif
                            <!-- 错误提示框结束 -->

                        </div><!-- /.box-header -->
                        <!-- 订单添加表单 start -->
                        <form role="form" action="/admin/order/update" method="post" enctype="multipart/form-data">
                            <!-- 隐藏域 -->
                            {{ csrf_field() }}
                            <div class="box-body">
                                <!-- 隐藏订单id -->
                                <input type="hidden" name="id" value="{{$data -> id}}">
                                 <!-- 联系人 -->
                                <div class="form-group">
                                    <label for="exampleInputEmail1">收货人</label>
                                    <input type="text" name="utname" value="{{$data -> utname}}" class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入联系人">
                                </div>
                                
                                <!-- address -->
                                <div class="form-group">
                                    <label for="exampleInputEmail1">收货地址</label>
                                    <input type="text" name="address" value="{{$data -> address}}" class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入收货地址">
                                </div>
                                <!-- 邮编 -->
                                <div class="form-group">
                                    <label for="exampleInputEmail1">邮编</label>
                                    <input type="text" name="post" value="{{$data -> post}}" class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入邮编">
                                </div>
                                <!-- 手机号 -->
                                <div class="form-group">
                                    <label for="exampleInputEmail1">联系方式</label>
                                    <input type="text" name="uphone" value="{{$data -> uphone}}" class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入邮编">
                                </div>
                                <!-- 订单金额 -->
                                <div class="form-group">
                                    <label for="exampleInputEmail1">订单金额</label>
                                    <input type="text" name="indent_price" value="{{$data -> indent_price}}" class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入金额">
                                </div>

                            </div><!-- /.box-body -->

                            <div class="box-footer">
                                <!-- 更新按钮 -->
                                <button type="submit" class="btn btn-primary">更新</button>
                                <!-- 重置按钮 -->
                                <button type="reset" class="btn btn-danger">重置</button>
                            </div>
                        </form>
                    </div><!-- /.box -->
                    <!-- 订单添加表单 end -->
                </div><!--/.col (left) -->
                <!-- right column -->

            </div>   <!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
@endsection
